Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a custom encoder in Serializer #554

Merged
merged 4 commits into from
Apr 24, 2024
Merged

Conversation

saranshdhingra
Copy link
Contributor

While instantiating a Serializer we can pass a custom encoder as the last argument.
When present, a proto will be converted into an array using the custom function(encoder) supplied instead of the encodeMessage method in the Serializer class.

Essentially this provides a way to short-circuit the encodeMessage method.

@saranshdhingra saranshdhingra requested review from a team as code owners April 19, 2024 10:34
Copy link
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two minor requests, otherwise this looks great!

tests/Tests/Unit/SerializerTest.php Outdated Show resolved Hide resolved
tests/Tests/Unit/SerializerTest.php Show resolved Hide resolved
@bshaffer bshaffer enabled auto-merge (squash) April 24, 2024 14:13
@bshaffer bshaffer merged commit be28b5a into main Apr 24, 2024
13 checks passed
@bshaffer bshaffer deleted the add-custom-encoders branch April 24, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants